package com.CRApp.service.impl;

import com.CRApp.mapper.ChatMapper;
import com.CRApp.pojo.Chat;
import com.CRApp.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * @Author : chp
 */
@Service
public class ChatServiceImpl implements ChatService {
    @Autowired
    private ChatMapper chatMapper;

    //增加用户聊天提问
    @Override
    public void insertChat(Chat chat) {

        chatMapper.insertChat(chat);
    }

    @Override
    public Chat[] getChatList(String userId) {
        return chatMapper.getChatTop10(userId);
    }

}
